package structural.decorator.v2;

/**
 * @Author: 蔡翔
 * @Date: 2019/12/9 11:24
 * @Version 1.0
 *
 * 这就是装饰者模式
 */
public class Test {
    public static void main(String[] args) {
        ABatterCake aBatterCake;
        aBatterCake = new BatterCake();
        aBatterCake = new EggDecorator(aBatterCake);
        aBatterCake = new EggDecorator(aBatterCake);
        aBatterCake = new SausageDecorator(aBatterCake);
        System.out.println(aBatterCake.getDesc()+" 售价："+aBatterCake.cost());
    }
}